package com.haiqi.modules.ship.service;

import com.github.pagehelper.PageInfo;
import com.haiqi.common.bean.PageBean;
import com.haiqi.common.persistence.dao.ShipPositionInfoMapper;
import com.haiqi.common.persistence.entity.ShipPositionInfo;
import com.haiqi.common.utils.PageUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2017/6/26 0026.
 */
@Service
public class ShipPositionInfoService {
    @Autowired
    private ShipPositionInfoMapper shipPositionInfoMapper;
    public List<ShipPositionInfo> findByImei(String[] str){
        return shipPositionInfoMapper.findByImei(str);
    }


    public  PageInfo<ShipPositionInfo> selectByServer(ShipPositionInfo shipPositionInfo,PageBean page){
        PageUtils.generatePage(page);
        List<ShipPositionInfo> datalist= shipPositionInfoMapper.select(shipPositionInfo);
        PageInfo<ShipPositionInfo> shipPositionInfos = new PageInfo<ShipPositionInfo>(datalist);
        return  shipPositionInfos;
    }


    public  PageInfo<ShipPositionInfo> selectShipServerCheck(ShipPositionInfo shipPositionInfo,PageBean page){
        PageUtils.generatePage(page);
        List<ShipPositionInfo> datalist= shipPositionInfoMapper.selectShipServerCheck(shipPositionInfo);
        PageInfo<ShipPositionInfo> shipPositionInfos = new PageInfo<ShipPositionInfo>(datalist);
        return  shipPositionInfos;
    }


    public  ShipPositionInfo selectByPrimaryKey(String guid){

       ShipPositionInfo shipPositionInfo= shipPositionInfoMapper.selectByPrimaryKey(guid);

        return  shipPositionInfo;
    }
}
